<template>
  <a-card :bordered="false">
<!--    <a-descriptions bordered :column="4">-->
<!--      <a-descriptions-item v-for="(item,index) of forList" :key="index" :label="item.name" :span="item.span">-->
<!--        {{ item.val }}-->
<!--      </a-descriptions-item>-->
<!--    </a-descriptions>-->
    <pulldown header="人员基本信息">
      <div slot="content">
        <a-descriptions bordered :column="4" :colon="true">
          <a-descriptions-item v-for="(item,index) of forList" :key="index" :label="item.name" :span="item.span">
            {{ item.dictCode ? getDictCode(item.dictCode,forData[item.key]):forData[item.key] }}
          </a-descriptions-item>
        </a-descriptions>
      </div>
    </pulldown>
    <pulldown header="人员入所信息">
      <div slot="content">
        <a-descriptions bordered :column="3">
          <a-descriptions-item v-for="(item,index) of forList2" :key="index" :label="item.name" :span="item.span">
            <template v-if="item.solt_dist">
              <template v-if="item.solt_dist === 'drugWays'">
                <a-checkbox-group
                  disabled
                  v-model="forData[item.key]"
                  name="checkboxgroup"
                  :options="plainOptions"
                />
              </template>
              <template v-if="item.solt_dist === 'drugType'">
                <a-checkbox-group
                  disabled
                  v-model="forData[item.key]"
                  name="checkboxgroup"
                  :options="plainOptions1"
                />
              </template>
            </template>
            <template v-else>
<!--              {{ forData[item.key] }}-->
              {{ item.dictCode ? getDictCode(item.dictCode,forData[item.key]):forData[item.key] }}
            </template>
          </a-descriptions-item>
        </a-descriptions>
      </div>
    </pulldown>
      <pulldown header="人员出所信息">
      <div slot="content">
        <a-descriptions bordered :column="3">
          <a-descriptions-item v-for="(item,index) of forList3" :key="index" :label="item.name" :span="item.span">
            {{ forData[item.key] }}
          </a-descriptions-item>
        </a-descriptions>
      </div>
    </pulldown>
  </a-card>
</template>

<script>
import pulldown from '../../modules/pulldown'
import {DataDetails} from "@api/sjsk/receiveCase";
export default {
  name: "recordLook",
  components:{ pulldown },
  data(){
    return {
      plainOptions:[
        { label: '吸烟', value: '1' },
        { label: '烫吸', value: '2' },
        { label: '注射', value: '3' },
        { label: '口服', value: '4' },
        { label: '鼻吸', value: '5' },
      ],
      plainOptions1:[
        { label: '海洛因', value: '1' },
        { label: '鸦片', value: '2' },
        { label: '大麻', value: '3' },
        { label: '吗啡', value: '4' },
        { label: '冰毒', value: '5' },
        { label: '冰毒片剂', value: '6' },
        { label: '咖啡因', value: '7' },
        { label: '安钠咖', value: '8' },
        { label: '氯胺酮', value: '9' },
        { label: '安眠酮', value: '10' },
        { label: '杜冷丁', value: '11' },
        { label: '可卡因', value: '12' },
        { label: '罂粟壳', value: '13' },
        { label: '摇头丸', value: '14' },
        { label: '其他苯丙胺类毒品', value: '15' },
        { label: '埃托啡', value: '16' },
        { label: '其他毒品', value: '17' },
      ],
      forList:[
        {name:'姓名',key:'realName',val:'张三',span:'1'},
        {name:'别名|绰号',key:'nickName',val:'女',span:'1'},
        {name:'性别',key:'sex',val:'女',span:'3',dictCode:'sex'},
        {name:'民族',key:'nation',val:'2022.07.14',dictCode:'nation'},
        {name:'出生日期',key:'birthday',val:'61KG'},
        {name:'身高（cm）',key:'height',val:'171cm',span:'2'},
        {name:'国籍',key:'country',val:'海南海口',dictCode:'country'},
        {name:'证件类型',key:'certificateType',val:'O型',dictCode:'other_certificate_type'},
        {name:'证件号码',key:'identityCard',val:'汉族',span:'2'},
        {name:'婚姻状态',key:'marriage',val:'未婚',dictCode:'matrimony_type'},
        {name:'文化程度',key:'education',val:'本科',dictCode:'degreeEducation'},
        {name:'职业',key:'occupation',val:'中国医科大学',span:'2',dictCode: 'work_situation'},
        {name:'户籍地',key:'householdTown',val:'2022.07.14'},
        {name:'户籍地详址',key:'householdAddress',val:'2022.07.14'},
        {name:'户籍地派出所',key:'householdPoliceStation',val:'18920394829',span:'2'},
        {name:'现居住地',key:'currentTown',val:'728374829@qq.com'},
        {name:'现居住地详址',key:'currentAddress',val:'李牧'},
        {name:'现居住地派出所',key:'currentPoliceStation',val:'18728394827',span:'2'},
      ],
      forList2:[
        {name:'戒毒所名称',key:'durgRehabilitatioName',val:'张三',span:'3'},
        {name:'初次吸毒日期',key:'firstDrugTime',val:'女'},
        {name:'既往戒毒次数',key:'previousDurgNum',val:'女'},
        {name:'是否复吸',key:'isReAbsorption',val:'2022.07.14',dictCode:'dict_yn'},
        {name:'吸毒方式',key:'drugWays',val:'61KG',span:'3',solt_dist:'drugWays'},
        {name:'吸毒类型',key:'drugType',val:'171cm',span:'3',solt_dist:'drugType'},
        {name:'入所原因',key:'reasonsAdmission',val:'海南海口'},
        {name:'决定机关',key:'decisionOrgan',val:'O型'},
        {name:'入所日期',key:'admissionTime',val:'汉族'},
        {name:'起始日期',key:'enterStartTime',val:'未婚'},
        {name:'截至日期',key:'enterEndTime',val:'未婚'},
      ],
      forList3:[
        {name:'戒毒所名称',key:'durgRehabilitatioName',val:'张三',span:'3'},
        {name:'预计出所时间',key:'personnelSex',val:'女'},
        {name:'出所原因',key:'reasonGoOut',val:'女'},
        {name:'出所去向',key:'departure',val:'2022.07.14',span:'2'},
        {name:'实际出所时间',key:'actualDepartureTime',val:'61KG'},
        {name:'接收民警',key:'receivePoliceName',val:'171cm'},
        {name:'民警联系方式',key:'nativePlace',val:'海南海口',span:'2'},
        {name:'接收家属',key:'familyName',val:'O型'},
        {name:'家属联系方式',key:'familyPhone',val:'汉族',span:'2'},
        {name:'第三方合影',key:'maritalStatus',val:'未婚',span:'3'},
      ],
      forData:[],
      forData2:[],
      forData3:[],
      id:''
    }
  },
  mounted() {
    this.id = this.$route.query.id
    this.receiveCaseLook()
  },
  methods: {
    getDictCode(key, val) {
      return this.$filterDictTextByCache(key, val)
    },
    receiveCaseLook() {
      if (this.$route.query.id) {
        DataDetails({id: this.id}).then(ser => {
          if (ser.success) {
            this.forData = ser.result
          }

        }).catch(err => {
          console.log(err)
        })
      } else {
        this.$message.error('非法进入！');
        history.go(-1)
      }

    }
  }
}
</script>

<style scoped>

</style>